package com.books.mapper.order;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.books.model.entity.order.OrderList;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author ZhouRui
 * @title: 码上就来
 * @projectName cbstore-spring-boot
 * @description: TODO
 * @date 2021/10/1114:06
 */
@Mapper
public interface OrderListMapper extends BaseMapper<OrderList> {
    @Select("select * from order_list")
    List<OrderList> getAllList();

    @Select("select * from order_list where buy_id=#{buyId}")
    List<OrderList> findAllList(String buyId);

    @Select("select * from order_list where id=#{id}")
    OrderList findList(String id);

    @Select("select * from order_list where product_id=#{productId}")
    List<OrderList> findByProductId(Integer productId);

    @Update("update order_list set buy_status=#{buyStatus} where id=#{id}")
    void updateBuyStatus(Integer buyStatus,String id);

    @Update ("update order_list set buy_status=#{buyStatus} where id=#{id}")
    void upStId (Integer buyStatus,String id);


    @Update ("update order_list set buy_evaluate=#{buyEvaluate} where id=#{id}")
    void upStatusId (Integer buyEvaluate,String id);

}
